--lpm_mux CBX_DECLARE_ALL_CONNECTED_PORTS="OFF" DEVICE_FAMILY="Cyclone IV E" LPM_SIZE=3 LPM_WIDTH=6 LPM_WIDTHS=2 data result sel
--VERSION_BEGIN 17.0 cbx_lpm_mux 2017:04:25:18:06:30:SJ cbx_mgl 2017:04:25:18:09:28:SJ  VERSION_END


-- Copyright (C) 2017  Intel Corporation. All rights reserved.
--  Your use of Intel Corporation's design tools, logic functions 
--  and other software and tools, and its AMPP partner logic 
--  functions, and any output files from any of the foregoing 
--  (including device programming or simulation files), and any 
--  associated documentation or information are expressly subject 
--  to the terms and conditions of the Intel Program License 
--  Subscription Agreement, the Intel Quartus Prime License Agreement,
--  the Intel MegaCore Function License Agreement, or other 
--  applicable license agreement, including, without limitation, 
--  that your use is for the sole purpose of programming logic 
--  devices manufactured by Intel and sold by Intel or its 
--  authorized distributors.  Please refer to the applicable 
--  agreement for further details.



--synthesis_resources = lut 12 
SUBDESIGN mux_3nb
( 
	data[17..0]	:	input;
	result[5..0]	:	output;
	sel[1..0]	:	input;
) 
VARIABLE 
	data0_wire[5..0]	: WIRE;
	data1_wire[5..0]	: WIRE;
	data2_wire[5..0]	: WIRE;
	result_node[5..0]	: WIRE;

BEGIN 
	data0_wire[] = (data[5..0] & (! sel[0..0]));
	data1_wire[] = (data[11..6] & sel[0..0]);
	data2_wire[] = (data[17..12] & sel[1..1]);
	result[] = result_node[];
	result_node[] = (((data0_wire[] # data1_wire[]) & (! sel[1..1])) # data2_wire[]);
END;
--VALID FILE
